package org.gen.code.core.view;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@RequestMapping("")
@Controller
public class ToViewController {

    @RequestMapping("")
    public String index() {
        return "index";
    }

    @RequestMapping("to/{page}")
    public String toView(@PathVariable("page") String page) {
        return page;
    }

    @RequestMapping("/view/to")
    public String toPage(@RequestParam("page") String page) {
        return page.replace("_", "/").replace("#", "/");
    }

}
